import React from "react";
import { View } from "@tarojs/components";
import { AtList, AtListItem } from "taro-ui";
import useNavigation from "@/uses/useNavigation";

const API: Taro.FC = () => {
  const navigation = useNavigation();
  return (
    <View>
      <AtList>
        {componentDatas.map((item, index) => {
          const { title, path } = item || ({} as any);
          return (
            <AtListItem
              key={index}
              title={title}
              onClick={() => {
                navigation.push(path);
              }}
            />
          );
        })}
      </AtList>
    </View>
  );
};
export default API;

const componentDatas = [
  {
    title: "Date",
    path: "/pages/api_example/date/index"
  }
];
